@extends('admin.layout.base')
@section('title', '会员列表页')
@section('content')
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            会员列表
        </h1>
        <ol class="breadcrumb">
            <li><a href="{{ url('/admin') }}"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="{{ url('/admin/user') }}">会员管理</a></li>
            <li class="active">会员列表</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header with-border">
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <form name="fm" method="post" action="{{url('/admin/user')}}" class="form-inline">
                            <div class="input-group" style="width: 260px;">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}" /> 
                                <input type="text" name="keyword" value="{{ $keyword }}" class="form-control pull-right" placeholder="请输入会员名或昵称">
                                <div class="input-group-btn">
                                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                                </div>
                            </div>
                        </form>
                        <table class="table table-bordered">
                            <tr>
                                <th>#</th><th>账号</th><th>性别</th><th>昵称</th><th>登录时间</th><th>操作</th>
                            </tr>
                            @foreach($users as $user)
                            <tr>
                                <td>{{$user->id}}</td>
                                <td>{{$user->user_name}}</td>
                                <td>{{$user->user_sex}}</td>
                                <td>{{$user->user_nickname}}</td>
                                <td>{{$user->user_logintime}}</td>
                                <td>
                                    <a href="{{ url('/admin/user/'.$user->id.'/edit') }}">编辑</a>
                                    <a href="{{ url('/admin/user/delete/'.$user->id) }}">删除</a>
                                </td>
                            </tr>
                            @endforeach
                        </table>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer clearfix">
                        {!! $users->appends(["keyword"=>$keyword])->render() !!}
                    </div>
                </div>
                <!-- /.box -->
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
@endsection
@section('pluginscript')
<!-- Slimscroll -->
<script src="{{ asset('/dist/admin/plugins/slimScroll/jquery.slimscroll.min.js') }}"></script>
<!-- FastClick -->
<script src="{{ asset('/dist/admin/plugins/fastclick/fastclick.js') }}"></script>
@endsection